package com.dreem.flyweight;

/**
 * @program: DesignParrtern
 * @description: 测试端
 * @author: Peng
 * @create: 2021-02-24  19:28
 **/
public class Client {
    public static void main(String[] args){
        WebSiteFactory factory = WebSiteFactory.getInstance();
        WebSite webSite = factory.getWebSiteGategory("新闻");
        webSite.use(new User("tom"));
        WebSite webSite1 = factory.getWebSiteGategory("体育");
        webSite.use(new User("jim"));
        WebSite webSite2 = factory.getWebSiteGategory("新闻");
        webSite.use(new User("jing"));
        WebSite webSite3 = factory.getWebSiteGategory("体育");
        webSite.use(new User("jun"));
        WebSite webSite4 = factory.getWebSiteGategory("新闻");
        webSite.use(new User("kim"));
        WebSite webSite5 = factory.getWebSiteGategory("体育");
        webSite.use(new User("jack"));

        System.out.println(factory.getSize());
    }
}
